import React, { Component } from "react";
import MainBanner from "./MainBanner";
import MainProductList from "./MainProductList";
import axios from 'axios'
export default class Main extends Component {
  constructor() {
    super()

    this.state = {
      banners: ['新歌曲', '新歌单', '新MV'],
      productList: ['推荐商品', '热销商品', '折扣商品']
    }
  }
  render() {
    const { banners, productList } = this.state
    return (
      <div>
        <MainBanner banners={banners} title={"1111"}></MainBanner>
        <MainBanner></MainBanner>
        <MainProductList productList={productList}></MainProductList>
      </div>
    )
  }
  componentDidMount() {
    axios.get("http://codercba.com:1888/api/detail/infos?houseId=51953704").then(res => {
      const banners = res.data.data.mainPart.topModule.housePicture.housePics
      this.setState({
        banners: banners
      },
      () => {
        console.log(this.state.banners,banners);
      }
      )
    })
  }
}
